$('.right-titleicon').on("click",function(e){
	projectVM.showMenulist()
})
		mui.plusReady(function(){
			 window.addEventListener('reloadPage', function(event) {//A页面自定义事件
				projectVM.page = 1;
				projectVM.getListData();
			 });
		});
		let that;
		projectVM = new Vue({
			el: "#content",
			data: {
				searchType:'todo',
				page:1,
				list:[]
			},
			created: function() {
				that = this;
				that.getDataList()
			},
			methods: {
				//获取 数据列表
				getDataList(){
					

					let persionData = JSON.parse(localStorage.getItem("neiosUser"));
					that.modifyBy = persionData.userId;//当前登录人
					let config = mui.neioConfig.getNeioConfig()
					let url = config.URL.getFaultTicketByPage;
					let param = {};
					param.pageSize = '10';
					param.current = that.page;
					param.workTicketCode = "";//工作票编号
					param.startCost = "";//维修成本起始
					param.endCos = "";//维修成本结束
					param.lastEnterName = "";//最近补录人姓名
					param.materielName = "";//元器件名称	
					param.materielBrand = "";//元器件品牌
					param.isEnterFinish = "";//是否补录完成
					param.ticketTime = "";//泄露电流值结束值
					param.currentUser = JSON.parse(localStorage.getItem('neiosUser')); //当前用户JSON
					param.stationName ="";//场站名
					param.areaCompanyCode = "";//分公司名称
					

					
					param.stationCode = localStorage.getItem('neiosStationCode') == null ? '1020' : localStorage.getItem('neiosStationCode');
					param.role = 'NEIOS_STATION';//persionData.roles;

					param.searchType = '0';//固定传0
					console.log(JSON.stringify(param))
					
					mui.neiosRequst.httpRequst(url,param,function(ret){
						console.log("返回："+JSON.stringify(ret))
						if(ret.code == 0){
						if(ret.code == 0){
							if(that.page == 1){
								mui('#scroll').pullRefresh().enablePullupToRefresh();
								mui('#scroll').pullRefresh().endPullupToRefresh();
								that.list = ret.data.records
							}
							if(ret.data.current >= ret.data.pages){
								console.log("====================禁用====================") 
								mui('#scroll').pullRefresh().disablePullupToRefresh();
								mui('#scroll').pullRefresh().endPullupToRefresh(true);
							}
							else{
								mui('#scroll').pullRefresh().endPullupToRefresh();
								that.list = that.list.concat(ret.data.records)
							}
						}
						}
						if( ret.code == 1){
							mui.toast(ret.msg)
						}
					},function(err){
						console.log("失败回掉："+JSON.stringify(err))
					})
				},
				
				//进入到元器件页面
				goNext(position){
					const path = "parts.html"
					let listData = that.list;
					let config = mui.neioConfig.getNeioConfig();
					let key = config.KEYS.PARTS;
					mui.neioConfig.setStorage(key,JSON.stringify(listData[position]));
					mui.openWindow({
						url: path,
						id: path,
						extras: {},
					waiting: {
						autoShow: false
					}
					});
				},
				//打开详情
				goDetail(position){
					const path = "detail.html"
					let listData = that.list;
					let config = mui.neioConfig.getNeioConfig();
					let key = config.KEYS.PARTS;
					mui.neioConfig.setStorage(key,JSON.stringify(listData[position]));
					mui.openWindow({
						url: path,
						id: path,
						extras: {},
					waiting: {
						autoShow: false
					}
					});
				},
				//补录
				insertParts(position){
					const path = "insertparts.html"
					let listData = that.list;
					let config = mui.neioConfig.getNeioConfig();
					let key = config.KEYS.PARTS;
					mui.neioConfig.setStorage(key,JSON.stringify(listData[position]));
					mui.openWindow({
						url: path,
						id: path,
						extras: {},
					waiting: {
						autoShow: false
					}
					});
				},
				
				hideOperBtn () {
					$('.todo').css('width','0');
					$('.toAppoint').css('width','0');
				},
				
			}
			
			})

		// 显示操作按钮
		function showOperBtn (el) {
			$('.todo').css('width','0');
			$(el).next().css('width','39vw');
		}

	mui.init({
      pullRefresh: {
        container: "#scroll", //待刷新区域标识，querySelector能定位的css选择器均可，比如：id、.class等
        down: { //下拉刷新
		  style: 'circle',
          height: 50, //可选,默认50.触发下拉刷新拖动距离,
          auto: false, //可选,默认false.首次加载自动下拉刷新一次
          contentdown: "下拉可以刷新", //可选，在下拉可刷新状态时，下拉刷新控件上显示的标题内容
          contentover: "释放立即刷新", //可选，在释放可刷新状态时，下拉刷新控件上显示的标题内容
          contentrefresh: "正在刷新...", //可选，正在刷新状态时，下拉刷新控件上显示的标题内容
          callback: async function() { //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
            projectVM.page = 1;
            projectVM.getListData("");
            ////没有更多内容了，endPulldown 传入true， 不再执行下拉刷新
			mui('#scroll').pullRefresh().endPulldownToRefresh();
			mui('#scroll').pullRefresh().enablePullupToRefresh();
			mui('#scroll').pullRefresh().endPullupToRefresh(true); 
        }
        },
        up: { //上拉加载
          height: 50, //可选.默认50.触发上拉加载拖动距离
          auto: false, //可选,默认false.自动上拉加载一次
          contentrefresh: "正在加载...", //可选，正在加载状态时，上拉加载控件上显示的标题内容
          contentnomore: '没有更多数据了', //可选，请求完毕若没有更多数据时显示的提醒内容；
          callback: async function() { //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
			projectVM.page = projectVM.page + 1;
            projectVM.getDataList("");
          }
        }
      },
    });